//
//  HCustomView.m
//  sqliteToEnity
//
//  Created by hament on 13-8-23.
//  Copyright (c) 2013年 hament. All rights reserved.
//

#import "HCustomView.h"


static NSGradient *gradientWithTargetColor(NSColor *targetColor) {
    NSArray *colors = [NSArray arrayWithObjects:[targetColor colorWithAlphaComponent:0], targetColor, targetColor, [targetColor colorWithAlphaComponent:0], nil];
    const CGFloat locations[4] = { 0.0, 0.35, 0.65, 1.0 };
    return [[NSGradient alloc] initWithColors:colors atLocations:locations colorSpace:[NSColorSpace sRGBColorSpace]];}


@implementation HCustomView




- (id)initWithFrame:(NSRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (void)drawRect:(NSRect)dirtyRect
{
    // Drawing code here.
    
    
    NSRect selectionRect = NSInsetRect(self.bounds, 0, 0);
    //[[NSColor colorWithCalibratedRed:24.0/255.0 green:111.0/255.0 blue:27.0/255.0 alpha:1.0] setStroke];
    // [[NSColor colorWithCalibratedRed:66.0/255.0 green:175.0/255.0 blue:40.0/255.0 alpha:1.0] setFill];
    //[[NSColor colorWithCalibratedRed:0.0/255.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.9] setStroke];
    [[NSColor colorWithCalibratedRed:0.0/0.0 green:0.0/255.0 blue:0.0/255.0 alpha:0.0] setFill];
    NSBezierPath *selectionPath = [NSBezierPath bezierPathWithRoundedRect:selectionRect xRadius:10 yRadius:10];
    [selectionPath fill];
    [selectionPath stroke];
    
}

@end
